/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * InicioCliente.java
 *
 * Created on 25-ago-2012, 14:03:24
 */
package Presentacion;

import Cliente.ScrabbleCliente;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import javax.swing.JPanel;

/**
 * Clase que muestra la ventana de inicio a la partida que extiende de javax.swing.JFrame
 * @author jero
 */
public class Inicio extends javax.swing.JFrame {

    /** Creates new form InicioCliente */
    
    private String serverAddress;
    private String serverPort;
    
    /*
     * Constructor de la clase
     */
    public Inicio() {
        this.getContentPane().setBackground(Color.BLACK);
        
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize = this.getSize();
        frameSize.height = ((frameSize.height > screenSize.height) ? screenSize.height : frameSize.height);
        frameSize.width = ((frameSize.width > screenSize.width) ? screenSize.width : frameSize.width);
        this.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); 
        initComponents();      
        this.setSize(600, 400);
        
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton1 = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenu3 = new javax.swing.JMenu();
        jMenu2 = new javax.swing.JMenu();
        jMenu4 = new javax.swing.JMenu();
        jMenu5 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("SCRABBLE Batman - Inicio");
        setAlwaysOnTop(true);
        setBounds(new java.awt.Rectangle(500, 100, 100, 100));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setFocusCycleRoot(false);
        getContentPane().setLayout(null);

        jButton1.setText("Iniciar");
        jButton1.setToolTipText("");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton1);
        jButton1.setBounds(130, 220, 90, 23);

        jLabel3.setIcon(new javax.swing.ImageIcon("C:\\Imagenes\\Joker.png")); // NOI18N
        getContentPane().add(jLabel3);
        jLabel3.setBounds(360, 50, 159, 197);
        getContentPane().add(jLabel4);
        jLabel4.setBounds(66, 30, 0, 0);
        getContentPane().add(jLabel5);
        jLabel5.setBounds(180, 80, 148, 0);
        getContentPane().add(jLabel6);
        jLabel6.setBounds(328, 20, 0, 60);

        jLabel7.setIcon(new javax.swing.ImageIcon("C:\\Imagenes\\ScrabbleLogo.png")); // NOI18N
        getContentPane().add(jLabel7);
        jLabel7.setBounds(50, 20, 190, 60);

        jLabel2.setIcon(new javax.swing.ImageIcon("C:\\Imagenes\\Batman.png")); // NOI18N
        getContentPane().add(jLabel2);
        jLabel2.setBounds(160, 70, 150, 40);

        jLabel1.setIcon(new javax.swing.ImageIcon("C:\\Imagenes\\batmanLogo.gif")); // NOI18N
        getContentPane().add(jLabel1);
        jLabel1.setBounds(240, 10, 100, 60);

        jMenu1.setText("Archivo");

        jMenu3.setText("Salir");
        jMenu1.add(jMenu3);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Ayuda");

        jMenu4.setText("Reglas del Juego");
        jMenu2.add(jMenu4);

        jMenu5.setText("Acerca de Scrabble Batman");
        jMenu2.add(jMenu5);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /*
     * Asigna la acción de crear un atributo de la clase [@ScrabbleCliente]
     */
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    
        ScrabbleCliente cliente = new ScrabbleCliente();
        cliente.Conexion();       
        this.setVisible(false);
}//GEN-LAST:event_jButton1ActionPerformed

 

    

    /**
     * @param args the command line arguments
     */
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenuBar jMenuBar1;
    // End of variables declaration//GEN-END:variables

    /**
     * Devuelve un atributo String con la dirección del servidor
     */
    public String getServerAddress() {
        return serverAddress;
    }

    /**
     * Asigna un valor al atributo serverAddress a partir del parámetro que recibe
     */
    public void setServerAddress(String serverAddress) {
        this.serverAddress = serverAddress;
    }

    /**
     * Devuelve un atributo String con el puerto del servidor
     */
    public String getServerPort() {
        return serverPort;
    }

    /**
     * Asigna un valor al atributo serverPort a partir del parámetro que recibe
     */
    public void setServerPort(String serverPort) {
        this.serverPort = serverPort;
    }
}
